﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/context.jsp" %>


<form action="${ctx}/system/maintenance/save" method="post" style="margin: 0px;" id="updateForm" onsubmit="return updateMaintenance();">
			
	<input type="hidden" name="maintenanceStation.id" value="${maintenanceStation.id}">
	<input  type = "hidden" id = "currPageId" name = "currPageId" />
	<table cellspacing="0" cellpadding="0" class="form-grid">
		<tbody>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">维修站编码：</td>
				<td><input type="text" id="maintenanceStation.number" name="maintenanceStation.number" size="15" value="${maintenanceStation.number}"  ${empty maintenanceStation && maintenanceStation == null ? ' dataType="Require" msg=""' : 'readonly="readonly"'}/></td>
				
				<td style="text-align: right; padding-right: 3px; width: 20%;">维修站名称：</td>
				<td ><input type="text" name="maintenanceStation.name" size="15" value="${maintenanceStation.name}"  dataType="Require" msg=""/></td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">负&nbsp;责&nbsp;人：</td>
				<td><input type="text" name="maintenanceStation.contact" size="15" value="${maintenanceStation.contact}"/></td>
				<td style="text-align: right; padding-right: 3px; width: 20%;">email：</td>
				<td ><input type="text" name="maintenanceStation.email" size="15" value="${maintenanceStation.email}"/></td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">联系电话：</td>
				<td><input type="text" name="maintenanceStation.telephone" size="15" value="${maintenanceStation.telephone}"/></td>
				<td style="text-align: right; padding-right: 3px; width: 20%;">传真：</td>
				<td><input type="text" name="maintenanceStation.fax" size="15" value="${maintenanceStation.fax}"/></td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">
					所在区域：
				</td>
				<td>
					<select name="maintenanceStation.region.id">
						<c:forEach var="region" items="${regions}" varStatus="status">
							<c:if test="${!empty maintenanceStation.region && region.id==maintenanceStation.region.id}">
								<option selected="selected" value="${region.id}"  >${region.number} - ${region.name }</option>
							</c:if>
							
							<c:if test="${empty maintenanceStation.region || maintenanceStation.region.id !=region.id}">
								<option value="${region.id}"  >${region.number} - ${region.name }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
				
				<td style="text-align: right; padding-right: 3px; width: 20%;">
					对应仓储：
				</td>
				<td>
					<select name="maintenanceStation.mainWarehouse.id">
						<c:forEach var="warehouse" items="${chooseWarehouses}" varStatus="status">
							<c:if test="${!empty maintenanceStation.mainWarehouse && warehouse.id==maintenanceStation.mainWarehouse.id}">
								<option selected="selected" value="${warehouse.id}"  > ${warehouse.name }</option>
							</c:if>
							
							<c:if test="${empty maintenanceStation.mainWarehouse || maintenanceStation.mainWarehouse.id !=warehouse.id}">
								<option value="${warehouse.id}"  > ${warehouse.name }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">
					备用仓储：
				</td>
				<td colspan="3">
					<table class="grid" cellspacing="0" width="40">
						<thead>
							<tr>	
								<td>
									选择
								</td>
								<td>
									备用仓储编码
								</td>
								<td>
									备用仓储名称
								</td>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="warehouse" items="${chooseWarehouses}" varStatus="status" >
								<tr onmouseover="this.style.backgroundColor= '#A0CFEC'" onmouseout="this.style.backgroundColor= '#ffffff'">
									<td> <input type="checkbox" name="warehousIds" value="${warehouse.id}" ${warehouse.selectedByMaintenance ? 'checked="checked"' : ''}> </td>
									<td> ${warehouse.code }</td>
									<td>${warehouse.name }</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
						
				</td>
			</tr>
			
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">地址：</td>
				<td colspan="3"><input type="text" name="maintenanceStation.address" size="50" value="${maintenanceStation.address}"/></td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">备&nbsp;&nbsp;&nbsp;&nbsp;注：</td>
				<td colspan="3"><input type="text" name="maintenanceStation.description" size="50" value="${maintenanceStation.description}"/></td>
			</tr>
		</tbody>
	</table>
			
	<div class="window_footer"><input type="submit" value="确定"  ></div>
</form>

<%@ include file="/include/script.jsp" %>